      </div><!--/.row-fluid-->

      <hr>

      <footer id="footer">
        <div class="container-fluid">
          <address style="center; width: 500px;">
            <strong>Jurusan Teknologi Informasi</strong><br>
            <strong>Fakultas Teknik Universitas Udayana<br></strong>
			<strong><span style="text-align:center; width:100%;">@2014</span><br></strong>
          </address>
        </div>
      </footer>

    </div><!--/.container-fluid-->

   <!-- Le javascript ================================================== -->
    <!-- Placed at the end of the document so the pages load faster -->
    <script src="js/jquery.js"></script>
    <script src="js/jquery-ui-1.9.2.custom.min.js"></script>
	<!-- The jQuery UI widget factory, can be omitted if jQuery UI is already included -->
	<script src="js/blueimp/vendor/jquery.ui.widget.js"></script>
	<!-- The Templates plugin is included to render the upload/download listings -->
	<script src="http://blueimp.github.io/JavaScript-Templates/js/tmpl.min.js"></script>
	<!-- The Load Image plugin is included for the preview images and image resizing functionality -->
	<script src="http://blueimp.github.io/JavaScript-Load-Image/js/load-image.min.js"></script>
	<!-- The Canvas to Blob plugin is included for image resizing functionality -->
	<script src="http://blueimp.github.io/JavaScript-Canvas-to-Blob/js/canvas-to-blob.min.js"></script>
	<!-- Bootstrap JS is not required, but included for the responsive demo navigatio

<!-- blueimp Gallery script -->
<script src="http://blueimp.github.io/Gallery/js/jquery.blueimp-gallery.min.js"></script>
<!-- The Iframe Transport is required for browsers without support for XHR file uploads -->
<script src="js/blueimp/jquery.iframe-transport.js"></script>
<!-- The basic File Upload plugin -->
<script src="js/blueimp/jquery.fileupload.js"></script>
<!-- The File Upload processing plugin -->
<script src="js/blueimp/jquery.fileupload-process.js"></script>
<!-- The File Upload image preview & resize plugin -->
<script src="js/blueimp/jquery.fileupload-image.js"></script>
<!-- The File Upload audio preview plugin -->
<script src="js/blueimp/jquery.fileupload-audio.js"></script>
<!-- The File Upload video preview plugin -->
<script src="js/blueimp/jquery.fileupload-video.js"></script>
<!-- The File Upload validation plugin -->
<script src="js/blueimp/jquery.fileupload-validate.js"></script>
<!-- The File Upload user interface plugin -->
<script src="js/blueimp/jquery.fileupload-ui.js"></script>
    <script src="js/jquery.form.js"></script>
    <script src="js/ajaxupload.3.5.js"></script>
	<script src="js/bootstrap-transition.js"></script>
	<script src="js/bootstrap-alert.js"></script>
	<script src="js/bootstrap-modal.js"></script>
	<script src="js/bootstrap-dropdown.js"></script>
	<script src="js/bootstrap-scrollspy.js"></script>
	<script src="js/bootstrap-tab.js"></script>
	<script src="js/bootstrap-tooltip.js"></script>
	<script src="js/bootstrap-popover.js"></script>
	<script src="js/bootstrap-button.js"></script>
	<script src="js/bootstrap-collapse.js"></script>
	<script src="js/bootstrap-carousel.js"></script>
      <script src="js/bootstrap-typeahead.js"></script>
    <!-- Jquery DataTable -->
    <script src="js/jquery.dataTables.js"></script>
    <script src="js/DT_bootstrap.js"></script>
    <script src="js/DT_reload.js"></script>
    <script src="js/bootstrap-timepicker.js"></script>
    <script src="js/bootstrap-switch.js"></script>
    <!-- Shadowbox -->
    <script src="js/shadowbox.js"></script>
    <script src="js/jquery.dynatable.js"></script>
    <!-- JS untuk validasi -->
    <script src="js/languages/jquery.validationEngine-ina.js"></script>
    <script src="js/jquery.validationEngine.js"></script>
    <script type="text/javascript">

		$('document').ready(function(){
			/*Fade In Content*/
			$(".span9").css("display","none");
			$('.span9').fadeIn('slow');

			/*Show Content*/



			/*GLOBAL TOOLTIP*/
			$('.inputFrm').tooltip({
				'placement':'bottom',
				'trigger' : 'hover'
			});

			/*Shadow Box*/
			Shadowbox.init({
				handleOversize: "drag",
				modal: true
			});

			/*Validation*/
			$("#formId").validationEngine();
			$("#formId").submit(function(){
				return false;
			});



			/*Date picker*/
			$('.dp').datepicker({
			  changeYear:'true',
			  changeMonth:'true',
			  yearRange:'1945:+2',
			  format: 'yyyy-mm-dd'
			});

			$('.dp').focus(function() {
				$(this).removeClass('validate[required,custom[date]]');
			});

			/*KRITERIA CARI*/
			$('.btn-kriteria-cari').click(function(){
				$('.kriteria-cari').fadeToggle('medium');
			});
			$('.btn-label-info').click(function(){
				$('.data-informasi').slideToggle('medium');
			});



			/*Action When Submit And Validate It's TRUE*/
			$("#btnSubmit").click(function(){
				var redirPage = $('#redirPage').val();
				if($("#formId").validationEngine('validate')){
					$("html, body").animate({ scrollTop: 0 }, 600);
					$('#warning').slideUp('slow');
					$('#info').slideUp('slow');
					$('#info').slideDown('slow');
					$.ajax({
						type : 'POST',
						cache : false,
						url : $('#formId').attr('action'),
						data : $('#formId').serialize(),
						success : function(msg){
							if(msg=='sukses'){
								console.log(msg);
								$('#btnSubmit').fadeOut('slow');
								$('#spanInfo').hide();
								$('#spanInfo').html('Berhasil diproses, silahkan tunggu beberapa saat...');
								$('#spanInfo').fadeIn('slow');
								setTimeout(function() {
								$('#info').slideUp('slow');}, 2500);
								setTimeout(function() {
								window.location=redirPage;}, 3500);
							}else{
								console.log(msg);
								$('#spanInfo').html(msg);
								setTimeout(function() {
								$('#info').slideUp('slow');}, 5000);
								setTimeout(function() {
								$('#warning').slideDown('slow');}, 6000);
								$('#btnSubmit').fadeIn('slow');
							}
						}
					});
				}
			});

			$('.tree-toggler').parent().children('ul.tree').toggle(300);

			$('.tree-toggler').click(function () {
				$(this).parent().children('ul.tree').toggle(300);
			});


			$('#toggleLogin').click(function(event) {
			/* Act on the event */
				$('#modalLogin').modal("show");
				return false;
			});

			$('#toggleLogout').click(function(event) {
				/* Act on the event */
				$.ajax({
					url: 'includes/act-login.php?act=logout',
					type: 'POST',
					dataType: 'json'
				})
				.done(function(data) {
				// console.log(data);
					if (data.error == 0) {
						location.reload();
					}
				// console.log("success");
				})
				.fail(function() {
				// console.log("error");
				})
				.always(function() {
				// console.log("complete");
				});
				return false;
			});

			$('#formLogin').submit(function(event) {
				/* Act on the event */
				// $('#modalLogin').modal("loading");
				var dataLogin = {
					username: $('#inputUser').val(),
					password: $('#inputPassword').val()
				}
				$.ajax({
					url: 'includes/act-login.php?act=login',
					type: 'POST',
					dataType: 'json',
					data: dataLogin,
				})
				.done(function(data) {
				// console.log(data);
					if (data.error == 0) {
						switch(data.tipe) {
							case 2:
								location.href = "admin/index.php";
								break;
							case 1:
								location.href = "index.php";
								break;
							case 0:
								location.href = "index.php";
								break;
						}
					} else {
						alert("password atau username salah");
					}
				// console.log("success");
				})
				.fail(function() {
				// console.log("error");
				})
				.always(function() {
				// console.log("complete");
				});
				return false;
			});
		});
	</script>

